<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let obj = {
        uname: '豆腐皮',
        age: '20',
        gender: '男',
        love: '跳',
      }
      //遍历对象
      for (let k in obj) {
        // console.log(obj['age'])
        // console.log(k) //'name' 'agr' 'gender' 'love' 是字符串类型的  相当于k==='age'
        // console.log(obj.k) //打印的结果是undefind  相当于console.log(obj.'name')会报错
        console.log(obj[k]) //k='属性名'
      }
    </script>
  </body>
</html>
